<template>
  <div class="volitionPlan">
    <div class="introduceImage" v-if="volitionData.introduce_image">
      <img :src="volitionData.introduce_image" lazy-load  mode="widthFix">
    </div>
    <!-- <div class="courseStratTime" v-if="volitionData.introduce_image">
      {{courseStrat}}
    </div> -->
  </div>
</template>

<script>
import {obtainVolitionProject} from '@/config/api'
import {dateRegExp} from '@/config/mUtils'
export default {
  data () {
    return {
      // 意志数据
      volitionData: [],
      // //  1 有数据
      // volitionState: 0
      // courseStrat: ''
      
    }
  },
  mounted () {
    let self = this
    // 初始化 意志计划界面
    self.initVolitionPlan()
  },
  methods: {
    // 初始化 意志计划界面
    async initVolitionPlan(){
      let self = this;
      if(self.$root.$mp.query.stratTime){
        self.courseStrat = dateRegExp ((self.$root.$mp.query.stratTime - 0), 'yyyy年MM月dd日')
        wx.showNavigationBarLoading()
        let willPlanInfo = await obtainVolitionProject()
        console.log(willPlanInfo, '.......willPlanInfo')
        if (willPlanInfo.status === 200) {
          // 意志数据
          self.volitionData = willPlanInfo.data
          // self.volitionState = 1
        }
        wx.hideNavigationBarLoading()
        wx.stopPullDownRefresh()
      } 
    },
  }
}
</script>

<style lang="less" scoped>
.volitionPlan{
  width: 100%;
  background: #ffffff;
  position: relative;
  .introduceImage{
    width: 100%;
    height: auto;
    img{
      width: 100% !important;
      height: auto;
      vertical-align: top;
    }
  }
  .courseStratTime{
    position: absolute;
    top: 300rpx;
  }
}
</style>
